<template>
  <div id="app">
    <div class="link">
      <router-link to="/home">首页</router-link>
      <router-link to="/search">搜索页</router-link>
    </div>

    <router-view></router-view>
  </div>
</template>

<script>
/*
声明式导航 - 跳转传参
  两种传参方式的区别
   1.查询参数传参(比较适合传多个参数)
      跳转: to="/path?参数名=值&参数名2=值
      获取:$route.query.参数名
   2.动态路由传参(优雅简洁，传单个参数比较方便)
      配置动态路由: path:"/path/参数名
      跳转: to="/path/参数值
      获取:$route.params.参数名
*/
export default {};
</script>

<style scoped>
.link {
  height: 50px;
  line-height: 50px;
  background-color: #495150;
  display: flex;
  margin: -8px -8px 0 -8px;
  margin-bottom: 50px;
}

.link a {
  display: block;
  text-decoration: none;
  background-color: #ad2a26;
  width: 100px;
  text-align: center;
  margin-right: 5px;
  color: #fff;
  border-radius: 5px;
}
</style>

